<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改处置转优车费用信息</title>
<jsp:include page="../../import.jsp" flush="true" />
<jsp:include page="../assParking/assParkCommon.jsp" flush="true" /><!-- 时间格式转换 -->
</head>
<body class="iframeBody">
	<div class="Wrapper">
		<div>
	<form id="carCostInfo_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <div class="fieldBox col_50">
            <div class="label">费用项</div>
            <div class="field">
               		<select name="costTypeCd" id="costTypeCd" ligerui="width: 160"  validate="{required:true}">
										<option value="" selected>请选择</option>
										<c:forEach items="${costTypeCdList}" var="item">
											 <c:if test='${vo.costTypeCd ==item.code}'>  
											    <option value="${item.code }" selected="selected" >${item.codeNm }</option>
											</c:if>
											 <c:if test='${vo.costTypeCd !=item.code}'>  
											   <option value="${item.code }" >${item.codeNm }</option>
											</c:if>
										</c:forEach>
					</select>
					    <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">金额</div>
            <div class="field">
                <input name="costAmt" id="costAmt" type="text" class="ui-textbox" value="${vo.costAmt/100 }"
                       validate="{required:true}">
                          <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">备注</div>
            <div class="field">
                <input name="costRem" id="costRem" type="text" class="ui-textbox" value="${vo.costRem }" >
            </div>
    </div>
      <div class="fieldBox col_50">
            <div class="label"></div>
            <div class="field">
            </div>
    </div>
    <div class="btnsBox" style="margin-top:60px;">
        <span id="saveCarCostInfo_Btn" class="sq-button sq-button-hasicon l-dialog-btn-ok">
        <i class="sqBtnIco_10"></i>保存</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
		</div>
	</div>
	<script type="text/javascript">
	 $(function () {
	        $("#carCostInfo_form").ligerForm({
	            validate: true
	        });
	        /*保存*/
	        $("#saveCarCostInfo_Btn").click(function (event) {
	            var form = liger.get("carCostInfo_form");
	            if (!form.valid()) {
	                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
	                return false; //验证不通过，不执行以下代码
	            }
	            var data = form.getData();
	            data["id"] = '${vo.id}';
	            data["carId"] = '${vo.carId}';
	            $.ligerDialog.hide();
	            var _url = '<%=path%>/ass/assTrailCarD/updateCarCost.do';
	            var wait_dialog;
	            $.ajax({
	                type: 'post',
	                dataType: 'json',
	                data: data,
	                url: _url,
	                beforeSend: function () {
	                    wait_dialog = top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
	                },
	                success: function (msg) {
	                    wait_dialog.close();
	                    if (msg.success == 1) {
	                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
	                        parent.window.location.href="<%=path%>/ass/assTrailCarD/toYCDealViewPage.do?flag=10&yc_deal_Id="+'${vo.carId}';
	                        frameElement.dialog.close();
	                    } else {
	                        top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
	                    }
	                }
	            });
	        });
	    });

	</script>
</body>
</html>